/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.be;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Programador
 */
@Entity
@Table(name = "CAN_TRANSACCION_EXTERNA_WEB")
@NamedQueries({@NamedQuery(name = "TransaccionExternaWeb.findAll", query = "SELECT t FROM TransaccionExternaWeb t"), @NamedQuery(name = "TransaccionExternaWeb.findByIdTransaccionExternaWeb", query = "SELECT t FROM TransaccionExternaWeb t WHERE t.idTransaccionExternaWeb = :idTransaccionExternaWeb"), @NamedQuery(name = "TransaccionExternaWeb.findByFidCanMoneda", query = "SELECT t FROM TransaccionExternaWeb t WHERE t.fidCanMoneda = :fidCanMoneda"), @NamedQuery(name = "TransaccionExternaWeb.findByNumeroCuentaTransaccionExterna", query = "SELECT t FROM TransaccionExternaWeb t WHERE t.numeroCuentaTransaccionExterna = :numeroCuentaTransaccionExterna")})
public class TransaccionExternaWeb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_TRANSACCION_EXTERNA_WEB", nullable = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long idTransaccionExternaWeb;
    @Column(name = "FID_CAN_MONEDA")
    private BigInteger fidCanMoneda;
    @Column(name = "NUMERO_CUENTA_TRANSACCION_EXTERNA", length = 50)
    private String numeroCuentaTransaccionExterna;
    @JoinColumn(name = "FID_CAN_BANCO", referencedColumnName = "ID_BANCO")
    @ManyToOne(fetch = FetchType.LAZY)
    private Banco fidCanBanco;
    @JoinColumn(name = "FID_CAN_TRANSACCION_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
    @ManyToOne(fetch = FetchType.LAZY)
    private TransaccionWeb fidCanTransaccionWeb;

    public TransaccionExternaWeb() {
    }

    public TransaccionExternaWeb(Long idTransaccionExternaWeb) {
        this.idTransaccionExternaWeb = idTransaccionExternaWeb;
    }

    public Long getIdTransaccionExternaWeb() {
        return idTransaccionExternaWeb;
    }

    public void setIdTransaccionExternaWeb(Long idTransaccionExternaWeb) {
        this.idTransaccionExternaWeb = idTransaccionExternaWeb;
    }

    public BigInteger getFidCanMoneda() {
        return fidCanMoneda;
    }

    public void setFidCanMoneda(BigInteger fidCanMoneda) {
        this.fidCanMoneda = fidCanMoneda;
    }

    public String getNumeroCuentaTransaccionExterna() {
        return numeroCuentaTransaccionExterna;
    }

    public void setNumeroCuentaTransaccionExterna(String numeroCuentaTransaccionExterna) {
        this.numeroCuentaTransaccionExterna = numeroCuentaTransaccionExterna;
    }

    public Banco getFidCanBanco() {
        return fidCanBanco;
    }

    public void setFidCanBanco(Banco fidCanBanco) {
        this.fidCanBanco = fidCanBanco;
    }

    public TransaccionWeb getFidCanTransaccionWeb() {
        return fidCanTransaccionWeb;
    }

    public void setFidCanTransaccionWeb(TransaccionWeb fidCanTransaccionWeb) {
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTransaccionExternaWeb != null ? idTransaccionExternaWeb.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransaccionExternaWeb)) {
            return false;
        }
        TransaccionExternaWeb other = (TransaccionExternaWeb) object;
        if ((this.idTransaccionExternaWeb == null && other.idTransaccionExternaWeb != null) || (this.idTransaccionExternaWeb != null && !this.idTransaccionExternaWeb.equals(other.idTransaccionExternaWeb))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.can.be.TransaccionExternaWeb[idTransaccionExternaWeb=" + idTransaccionExternaWeb + "]";
    }

}
